<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><#assign path="${request.getContextPath()}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="${path}/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="${path}/jquery/jquery.blockUI.js" type="text/javascript"></script>
<script src="${path}/ckeditor/ckeditor.js" type="text/javascript" ></script>
<script src="${path}/ckeditor/adapters/jquery.js" type="text/javascript"></script>
<link href="${path}/userCenter/css/validationEngine.jquery.css" type="text/css" rel="stylesheet"/>
<script src="${path}/jquery/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="${path}/jquery/jquery.validationEngine.js" type="text/javascript"></script>
<link href="${path}/css/reset.css" type="text/css" rel="stylesheet"/>
<link href="${path}/css/frame.css" type="text/css" rel="stylesheet"/>
<link href="${path}/css/header.css" type="text/css" rel="stylesheet"/>
<link href="${path}/css/sidebar.css" type="text/css" rel="stylesheet"/>
<link href="${path}/css/footer.css" type="text/css" rel="stylesheet"/>
<link href="${path}/blogManager/articlesManager/css/writeArticle.css" type="text/css" rel="stylesheet"/>
<script src="${path}/blogManager/articlesManager/js/writeArticle.js" type="text/javascript"></script>
<title>WriteBlog</title>

</head>

<body>
<div id="wrapper">
	<#include "/header.ftl" />
	<div id="content">
		<form id="articleForm">
		<ul id = "articleWriteUL">
				<!-- <li><span id="submitFeedBack">Update article success</span></li> -->
				<@s.hidden id="categoryName" value='${(blogArticle.article.articleCategories.categoryName)?default("SelectCategory")}' />
				<li><span class="articleSpan"><@s.text name="article.category"/>:</span><@s.select theme ="simple" cssClass="required" id="articleCategory"  list="#request.artcleCategories" listKey="id" listValue="categoryName" headerKey="" headerValue="SelectCategory"  /></li>
				<li><span class="articleSpan"><@s.text name="article.title"/>:</span><input class="required" type="text" id="title" value='${(blogArticle.article.title)?default("")}'/></li>
				<li><span class="articleSpan"><@s.text name="article.keyword"/>:</span><input class="required" type="text" id="keyWords" value="${keyWords?default("")}" /> </li>
				<li><span class="articleSpan"><@s.text name="article.articleSource"/>:</span><input type="text" id="articleSource" value="${(blogArticle.article.articleSource)?default("")}" /> </li>
				<li><span class="articleSpan"><@s.text name="article.isDisplayReadMore"/>:</span>
					<#if blogArticle??>
						<#if blogArticle.displayReadMore?string == "true">
							<input type="checkbox" id="displayReadMore" checked="true" />
						<#else>
							<input type="checkbox" id="displayReadMore" />
						</#if>
					<#else>
					 		<input type="checkbox" id="displayReadMore" checked="true"/>
					</#if>
				</li>
				<li><span class="articleSpan"><@s.text name="article.commentOpen"/>:</span>
					<#if blogArticle??>
						<#if blogArticle.commentOpen?string == "true">
							<input type="checkbox" id="commentOpen" checked="true" />
						<#else>
							<input type="checkbox" id="commentOpen" />
						</#if>
					<#else>
					 		<input type="checkbox" id="commentOpen" checked="true" />
					</#if>
				</li>
				<li><span class="articleSpan"><@s.text name="article.content"/>:</span></li>
				<li><p  id="articleContent"  name="articleContent" ></p></li>	
				<li><span class="articleSpan"><@s.text name="article.articlePreView"/>:</span></li>
				<li><p  id="articlePreView"  name="articlePreView" ></p></li>	
				<@s.hidden id="contentStr" value='${(blogArticle.article.content)?default("")}' />
				<@s.hidden id="preViewStr" value='${(blogArticle.article.articlePreView)?default("")}' />
				<#if blogArticle?exists>
					<li><input id="articleSubmit" type="button" value='<@s.text name="article.update"/>'/>
						<a id='url' href='<@s.url action="updateBlogArticle" namespace="/blogManager" ><@s.param name="bid" value="${blogArticle.id}"/></@s.url>' style="display:none"></a>
					</li>	
					<input id="preViewArticle" type="button" value='<@s.text name="article.preView.submit"/>'/>	
				<#else>
					<li><input id="articleSubmit" type="button" value='<@s.text name="article.submit"/>'/>
					<a id='url' href='<@s.url action="saveBlogArticle" namespace="/blogManager" />' style="display:none"></a>
			    </li>
				<input id="preViewArticle" type="button" value='<@s.text name="article.preView.submit"/>'/>	
				</#if>
		</ul>
		</form>
		<form id="preview" action="preViewBlogArticle" namespace="/blogManager" method="post" target="blank" >
			<@s.hidden id="preArticleTitle" name="title" value=""/>
			<@s.hidden id="preArticleCategoryId" name="articleCategoryId" value=""/>
			<@s.hidden id="preKeyWords" name="keyWords" value="" />
			<@s.hidden id="preArticleSource" name="articleSource" value=""/>
			<@s.hidden id="preArticleContent" name="articleContent" value=""/>
			<@s.hidden id="PreArticlePreView" name="articlePreView" value=""/>
			<@s.hidden id="preDisplayReadMore" name="displayReadMore" value=""/>
			<@s.hidden id="preCommentOpen"  name="commentOpen" value="" />
			
		</form>
	</div>
	<div id="updateFeedBack" ><h2>Update Success</h2></div>
	<div id="addFeedBack" ><h2>Add Success</h2></div>
	<#include "/blogManager/managerSidebar.ftl" />
	<#include "/blogManager/managerFooter.ftl" />
	
</div>	
</body>

</html>